﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace SocialShare.MVC.Domain.User
{
    public class UserBase
    {        
        public Int32 UserId
        {
            get;
            set;
        }

        [Required(ErrorMessage = "Please enter first name.")]
        [StringLength(20, ErrorMessage = "First name is too long")]
        public String FirstName
        {
            get;
            set;
        }

        [Required(ErrorMessage = "Please enter last name.")]
        [StringLength(20, ErrorMessage = "Last name is too long")]
        public String LastName
        {
            get;
            set;
        }

        [RegularExpression(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*")]
        [Required(ErrorMessage = "Please enter User name.")]
        [StringLength(50, ErrorMessage = "User name is too long")]
        public String UserName
        {
            get;
            set;
        }

        [RegularExpression(@"^[a-zA-Z0-9]{6,50}$")]
        [Required(ErrorMessage = "Please enter password")]
        [StringLength(6, ErrorMessage = "Password is too long")]
        public String Password
        {
            get;
            set;
        }

        public Boolean IsActive
        {
            get;
            set;
        }
    }
}
